package com.itheima.reggie.common;

/**
 * @author ghy
 * @version v1.0
 * create on 2022/11/18 11:06
 */
public class ThreadLocalUtils {

    private static final ThreadLocal<Long> THREAD_LOCAL = new ThreadLocal<>();

    //设置值到当前线程的绑定map中
    public static void set(Long id){
        THREAD_LOCAL.set(id);
    }

    //从当前线程的绑定map中获取数据
    public static Long get(){
        return THREAD_LOCAL.get();
    }

    //从当前线程的绑定map中移除数据
    public static void remove(){
        THREAD_LOCAL.remove();
    }

}
